package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingLevelDto;
import com.zzyl.dto.NursingLevelPageParamDto;
import com.zzyl.entity.NursingLevel;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingLevelVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface NursingLevelMapper {
    //查询已与等级绑定的计划个数
    Long selectPlanById(Long id);

    //条件分页查询护理等级
    Page<NursingLevelVo> selectByPage(NursingLevelPageParamDto nursingLevelPageParamDto);

    //查询所有护理等级
    List<NursingLevelVo> selectAll();

    //新增护理等级
    void insert(NursingLevel nursingLevel);

    //查询新增的名称是否已存在（返回数量）
    Long selectByName(String name);

    //根据ID查询
    NursingLevelDto selectById(Long id);

    //编辑等级信息
    void updateLevel(NursingLevel nursingLevel);

    //删除护理等级
    @Delete("delete from nursing_level where id=#{id};")
    void deleteLevel(Long id);

    //更新护理等级状态
    void updateStatus(Long id, Integer status);
}
